package hos.demo;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.MediatorLiveData;

import hos.thread.lifecycle.LifecycleHandler;
import hos.thread.lifecycle.LifecycleRunJob;
import hos.thread.lifecycle.LifecycleRunJobLive;
import hos.thread.lifecycle.LifecycleThread;
import hos.thread.lifecycle.LifecycleThreadResult;

/**
 * <p>Title: TextFragment </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2023/8/2 13:09
 */
class TextFragment extends Fragment {

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        LifecycleHandler.<String>getLifecycle(this).postOnMain(run -> {

        });
        LifecycleRunJobLive.<String>getLifecycleLive(new MediatorLiveData<>(), stringRunnableJob -> null)
                .onSuccess((lifecycleRunJob, s) -> null);
        LifecycleRunJob.<String>getLifecycle(stringRunnableJob -> null).onSuccess((lifecycleRunJob, s) -> null);
        new LifecycleThreadResult.CANCEL().doCancel(s -> null);
        LifecycleThread.<String>getLifecycleJob(runnableJob -> null)
                .onProgress(value -> {
                    return null;
                })
                .onSuccess((job, s) -> {
                    return null;
                });
        LifecycleThread.runLifecycleJobLive(this, runnableJob -> null);

    }
}
